home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Python-1.4 / Docs / Amiga / general < prev    next >
Text File  |  1998-06-24  |  5KB  |  131 lines

  1.  
  2.              GENERAL NOTES ON THE AMIGA VERSION OF PYTHON 1.4
  3.  
  4.                       Irmen de Jong - ijong@gak.nl
  5.                                27 dec. 1996
  6.  
  7.  
  8. MODULE SEARCH PATH
  9. ------------------
  10.  
  11. Version  1.4  introduced  a  different treatment of the module search path.
  12. The  current  directory  is  no longer by default part of the module search
  13. path.   Instead,  the  following  procedure  gives  the  module search path
  14. (sys.path):
  15.  
  16. - sys.path is set to the default PYTHONPATH, which is "Python:lib"
  17. - if  the  global  environment  variable  PYTHONPATH is set, the paths listed
  18.   there  will be inserted before the default path.  PYTHONPATH is a semicolon
  19.   (;) separated list of directories, like "WORK:pylib;Python:lib/mymods".
  20. - the  path of the script which was given as an argument is inserted in front
  21.   of the search path. If no script was given as argument, '' will be inserted
  22.   (which is the current directory).
  23.  
  24.  
  25. AMIGA SPECIFIC MODULES
  26. ----------------------
  27.  
  28. Version  1.4 introduced a clean way of installing platform specific library
  29. files.   In  the Lib drawer there is anoter drawer called site-python.  All
  30. Amiga  specific modules are put here.  There is a simple way of using them:
  31. place the
  32.  
  33.     import site
  34.  
  35. statement  somewhere  at  the  top  of all code that must use site-specific
  36. modules.   This  will  modify  the module search path and also run any site
  37. specific  initialization code (by importing the sitecustomize module, which
  38. should  also  be  placed in the site-python drawer).  Currently there is no
  39. sitecustomize  module  on  the Amiga.  If you don't like to import the site
  40. module (why?) just use sys.path.append('Python:Lib/site-python').
  41.  
  42. You  can  now  simply import any Amiga specific modules, regardless of them
  43. being built-in (like arexxll) or in a .py source file:
  44.  
  45.     import ARexx
  46.  
  47.  
  48.  
  49. POSIX REPLACEMENTS
  50. ------------------
  51.  
  52. In  lib/ there are dummy modules `posixpath' and `posix'.  They just import
  53. `amigapath'  and  `amiga', thereby making some other modules and files work
  54. because they don't use os.path and os.
  55.  
  56.  
  57. About the networking support (AmiTCP)
  58. -------------------------------------
  59.  
  60. The  python  binary is compiled with AmiTCP support.  The interpreter still
  61. works  even  if  you don't have AmiTCP, but the extra functionality (mainly
  62. the  socket  module)  can't be used without AmiTCP (obviously).  Some extra
  63. functions  already work if you only have the usergroup.library, and not the
  64. full  AmiTCP  package:   the  crypt,  pwd  and grp modules for instance.  A
  65. MultiuserFileSystem-compatible  usergroup.library can be found on Aminet (I
  66. didn't  try it -- beware).  Usergroup.library can also be found in the demo
  67. version of AmiTCP, which is also on Aminet.
  68.  
  69.  
  70. About Timezones
  71. ---------------
  72.  
  73. As  another  side-effect  of  linking  in AmiTCP stuff, Python extracts the
  74. timezone information from your current locale preferences.  No need anymore
  75. for a TZ environment var.  (One small problem:  the name of the timezone is
  76. no longer known, and is replaced by '???'.) If the locale prefs couldn't be
  77. read, the timezone information is taken from ENV:TZ, which must be a string
  78. like 'MET-1' (MET, -1 hour from GMT).
  79.  
  80.  
  81. sys.platform
  82. ------------
  83.  
  84. This is defined as 'amiga'. No upper case A.
  85.  
  86.  
  87. About modifying library files
  88. -----------------------------
  89.  
  90. You  should  not  change anything in one of the library files.  The library
  91. files  should  always  behave the same on all platforms that supports them.
  92. (Note:   I  said BEHAVE.  You are free to modify the implementation but the
  93. BEHAVIOR should remain the same.)
  94.  
  95.  
  96. Workbench startup
  97. -----------------
  98.  
  99. Since  1.4,  Amiga Python contains some code to make it possible to use the
  100. Workbench  to start python or python programs.  The interpreter already has
  101. an  icon.   Doubleclick  it  to  start python in interactive mode.  Use the
  102. well-known multiselect (shift-click) to select any scripts to execute.  Any
  103. additional  files  which  are multi-selected will be passed as command line
  104. arguments.
  105.  
  106. SCRIPT  ICONS.   Look  in  the  `Icons'  directory for icon templates:  use
  107. def_py.info  and  def_pyc.info  as  icon  templates for .py and .pyc files.
  108. Just  make  sure the default tool is set to `Python:Python'.  Any tooltypes
  109. in  the  icon  are  converted  to  command  line  arguments  for the Python
  110. interpreter.   The  `-c'  option  is special:  don't enter the program text
  111. after the `-c' option, but make a NEW TOOLTYPE for it, right after the `-c'
  112. tooltype.   Using  the  `-c'  option you can even make python scripts which
  113. reside  in  the  icon  only, without a scriptfile on disk.  When starting a
  114. Python   program  from  the  Workbench,  any  additional  files  which  are
  115. multi-selected will be passed as command line arguments.
  116.  
  117.  
  118. SOURCE CODE and other files
  119. ---------------------------
  120.  
  121. For  the original source code distribution, which also includes all library
  122. files,    a    bunch   of   docs   and   many   example   programs,   check
  123. http://www.python.org.    BTW,   this  site  contains  a  lot  more  stuff:
  124. reference  manuals,  contributed  files, online documentation, FAQ's, news,
  125. etc.  etc.
  126.  
  127. For the Amiga source code, see Aminet in the same location as you found
  128. this.  It should be named `Python14_Src.lha'.
  129.  
  130.  
  131.